package com.ada.demo

object ChangeValue {
  def main(args: Array[String]): Unit = {
    var a = 10;
    var b = 20;
    println(s"${a} = ${b}")

//    var c = a;
//    a = b;
//    b = c;
//    println(s"${a} = ${b}")

//    a = a + b; //30
//    b = a - b; //10
//    a = a - b; //20
//    println(s"${a} = ${b}")

    a = a ^ b; //30
    b = a ^ b; //10
    a = a ^ b; //20
    println(s"${a} = ${b}")
  }
}
